Using special-case hardware units for facilitating access control lists on a networking element

ABSTRACT

Access control lists (ACLs) include one or more rules that each define a condition and one or more actions to be performed if the condition is satisfied. In one embodiment, the conditions are stored on a ternary content-addressable memory (TCAM), which receives a portion of network traffic, such as a frame header, and compares different portions of the header to entries in the TCAM. If the frame header satisfies the condition, the TCAM reports the match to other elements in the ACL. For certain conditions, the TCAM may divide the condition into a plurality of sub-conditions which are each stored in a row of the TCAM. To efficiently use the limited space in TCAM, the networking element may include one or more comparator units which check for special-case conditions. The comparator units may be used in lieu of the TCAM to determine whether the condition is satisfied.

BACKGROUND

Computer systems often include multiple computers and/or serversconfigured to communicate over a network. In Ethernet networks, forexample, packets of data are sent from computer to computer according toone or more communication protocols, such as Transmission ControlProtocol (TCP) and Internet Protocol (IP). Each computer in the networkmay include a host Ethernet adapter configured to facilitatecommunications that terminate at an operating system (OS) running on therespective computer. The operating system running on each computer mayinclude a device driver configured to interact with the host Ethernetadapter of the respective computer.

SUMMARY

Embodiments herein disclose a method using access control lists. Themethod includes evaluating a portion of received network traffic using acomparator unit of a networking element, the comparator unit comprisingone or more hardware units for determining whether the network trafficportion satisfies a condition associated with an access control list(ACL). The method further includes transmitting a result of evaluatingthe network traffic portion using the comparator unit to a contentaddressable memory (CAM). Upon determining that the result satisfies anentry in the CAM, the method selects one or more actions correspondingto the satisfied entry to be performed by the networking element,wherein the one or more actions are part of the ACL.

Another embodiment disclosed herein describes a networking element thatincludes a processor and a comparator unit. The comparator unit isconfigured to evaluate a portion of received network traffic using acomparator unit of a networking element, the comparator unit comprisingone or more hardware units for determining whether the network trafficportion satisfies a condition associated with an ACL. The networkelement also includes a CAM configured to receive a result of evaluatingthe network traffic portion from the comparator unit and, upondetermining that the result satisfies an entry in the CAM, select one ormore actions corresponding to the satisfied entry to be performed by theprocessor, wherein the one or more actions are part of the ACL.

Another embodiment disclosed herein describes a computer program productthat compares network traffic to ACLs. The program product includingcomputer-readable program code configured to evaluate a portion ofreceived network traffic using a comparator unit of a networkingelement, the comparator unit comprising one or more hardware units fordetermining whether the network traffic portion satisfies a conditionassociated with an ACL. The program product including computer-readableprogram code configured to transmit a result of evaluating the networktraffic portion using the comparator unit to a CAM. Upon determiningthat the result satisfies an entry in the CAM, the program productincluding computer-readable program code configured to select one ormore actions corresponding to the satisfied entry to be performed by thenetworking element, wherein the one or more actions are part of the ACL.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

So that the manner in which the above recited aspects are attained andcan be understood in detail, a more particular description ofembodiments of the invention, briefly summarized above, may be had byreference to the appended drawings.

It is to be noted, however, that the appended drawings illustrate onlytypical embodiments of this invention and are therefore not to beconsidered limiting of its scope, for the invention may admit to otherequally effective embodiments.

FIG. 1 illustrates hardware elements of a memory system for managingmultiple ACLs in a networking element, according to one embodimentdescribed herein.

FIG. 2 is a chart that matches a satisfied condition with an action set,according to one embodiment described herein.

FIG. 3 illustrates the number of TCAM entries needed for one logicalcomparison, according to one embodiment described herein.

FIG. 4A illustrates a special-case instruction for performing a logicalcomparison, according to one embodiment described herein.

FIG. 4B is a chart describing the different portions of the special-caseinstruction shown in FIG. 4A, according to one embodiment describedherein.

FIG. 5 is a block diagram of a system for evaluating special-caseinstructions used in an ACL, according to one embodiment describedherein.

FIG. 6 illustrates a hardware diagram of a comparison unit shown in FIG.5, according to one embodiment described herein.

FIG. 7 illustrates a method for evaluating special-case instructions inan ACL, according to one embodiment described herein.

FIG. 8 is a block diagram of a networking element, according to oneembodiment described herein.

DETAILED DESCRIPTION

Network devices may be configured to manage or control inbound andoutbound traffic flow based on one or more predefined conditions. Thepredefined conditions may be represented in the form of an accesscontrol list (ACL) specifying actions to be performed by a networkdevice when the predefined conditions are met. The ACL compares aportion of network traffic—e.g., a frame header—to one or more of theconditions. If a condition is satisfied, the ACL instructs the networkdevice to perform a corresponding action. The actions are not limited toany particular network optimization technique. For instance, the actionsmay apply to network security, quality of service, prioritization, powerconservation, and the like.

As such, ACLs permit network administrators to manage network trafficflowing through a networking element to optimize network security,performance, quality of service (QoS), and the like. For example, thenetworking element may be an integrated circuit (IC) located within alarger network device—e.g., a router, switch, bridge, etc. Furthermore,the ACLs may be used in endpoints in a network such as servers of usercomputing devices. Moreover, a single network element may use multiplestored ACLs to manage traffic flows. This enables different ACLs to becustomized for different optimization tasks (e.g., network performanceversus network security). The networking element compares the incomingframes of the network traffic to the ACLs which specify one or moreactions to be performed by the networking element. Stated differently,multiple ACLs may be independently maintained within a single networkingelement in order to achieve different network optimizations.

In one embodiment, for certain conditions, such as testing whether areceived number falls within a certain numerical range, the TCAM maydivide the condition into a plurality of sub-conditions which are eachstored in a respective row of the TCAM. As conditions become morecomplex, more rows of the TCAM are needed. To efficiently use thelimited space in the TCAM, the networking element may include one ormore comparator units which check for special-case conditions. Thecomparator units may be used in lieu of the TCAM to determine whetherthe condition is satisfied. Thus, instead of directly determiningwhether the received data satisfies the condition, the TCAM monitors theoutput of the comparator units. In one embodiment, by using thecomparator units, the TCAM needs only one entry to monitor the output ofthe comparator units instead of using multiple rows to evaluate thereceived data.

In some embodiments, a system administrator may configure the differentcomparator units to check for different conditions. For example, onecomparator unit may check to see if a TCP source port is greater than1023 while another comparator unit determines if the received frame isassociated with a UDP packet. In one embodiment, the networking elementincludes a register that is accessible by the system administrator andthat stores instructions for configuring the comparator units to performdifferent functions. The administrator may access the register to add,change, or remove the different instructions, thereby changing thefunctions of the comparator units associated with the entries in theregister.

In the following, reference is made to embodiments of the invention.However, it should be understood that the invention is not limited tospecific described embodiments. Instead, any combination of thefollowing features and elements, whether related to differentembodiments or not, is contemplated to implement and practice theinvention. Furthermore, although embodiments of the invention mayachieve advantages over other possible solutions and/or over the priorart, whether or not a particular advantage is achieved by a givenembodiment is not limiting of the invention. Thus, the followingaspects, features, embodiments and advantages are merely illustrativeand are not considered elements or limitations of the appended claimsexcept where explicitly recited in a claim(s). Likewise, reference to“the invention” shall not be construed as a generalization of anyinventive subject matter disclosed herein and shall not be considered tobe an element or limitation of the appended claims except whereexplicitly recited in a claim(s).

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system.”Furthermore, aspects of the present invention may take the form of acomputer program product embodied in one or more computer readablemedium(s) having computer readable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: an electrical connectionhaving one or more wires, a portable computer diskette, a hard disk, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), an optical fiber,a portable compact disc read-only memory (CD-ROM), an optical storagedevice, a magnetic storage device, or any suitable combination of theforegoing. In the context of this document, a computer readable storagemedium may be any tangible medium that can contain, or store a programfor use by or in connection with an instruction execution system,apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, RF, etc., or any suitable combination ofthe foregoing.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java, Smalltalk, C++ or the like and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention are described below with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer program instructions. These computer program instructions maybe provided to a processor of a general purpose computer, specialpurpose computer, or other programmable data processing apparatus toproduce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

FIG. 1 illustrates hardware elements of a memory system 100 for managingmultiple ACLs in a networking element, according to one embodimentdescribed herein. Each ACL includes one or more rules. As used herein, arule includes a condition and a corresponding action that is performedif the condition is satisfied. For example, the ACL may include acondition that if the TCP source port is greater than 1023 (i.e., thecondition) then the packet should be discarded (i.e., the action).Accordingly, the action is performed only if the condition is true.

In one embodiment, ACLs may have more than one rule (i.e., more than onecondition and action pair), and thus, may properly be referred to asrule groups. For example, the system administrator may want to forward acopy of a received frame if the IP source address is 9.*.*.* (where *indicates a wildcard) to a different networking element than thedestination networking element (Rule 1) but drop the packet if TCPsource port is greater than 1023 (Rule 2). In one embodiment, to preventconflicts within the same ACL, the rules are arranged in a hierarchy,usually based on the order the rules are listed in the ACL. Thus, theidentified action may change based on the ordering of the rules in thehierarchy.

Continuing the previous example, assume Rule 1 is higher in thehierarchy than Rule 2. If the networking element receives a data framewith a header that contains an IP source address of 9.10.000.1 and a TCPsource port of 1024, only the condition associated with Rule 1 (i.e.,forwarding the packet) is performed even though the frame technicallyalso satisfies the condition associated with Rule 2. This organizationenables the ACL to have multiple rules yet manage any potentialconflicts that may arise. In one embodiment, the ACL may be thought ofas a list of rules that are parsed in a top down manner where thecontents of a received frame are compared to the conditions in therules. The first rule having a condition that is satisfied by the frameheader is selected. Even if other rules in the ACL have conditionssatisfied by the header, those rules as well as their correspondingactions, are neither selected nor performed. Moreover, although theembodiments herein disclose comparing the conditions to the contents ofdata frames, in other embodiments, any type of network traffic may beevaluated against the condition (e.g., data packets, segments, and thelike).

At least in some embodiments, each rule in an ACL may have a pluralityof actions that correspond to a single condition—i.e., instead of asingle action corresponding to the single condition. This plurality ofactions is referred to herein as an action set. When a condition of arule is satisfied, the ACL may return a plurality of actions to beperformed by the networking element—i.e., instead of returning only thesingle action. In one embodiment, the action set may be further dividedinto different action types (e.g., a forwarding action, copying to acontrol point, altering a portion of the frame header, and the like)where each rule in the ACL defines a specific action to perform for eachaction type. Accordingly, whichever condition is satisfied first, allthe actions established by that the action set of the rule specifyingthe condition are performed by the networking element. Depending on theembodiment, two rules within the same ACL may have the same action setor may have different actions for one or more of the action types in theaction set.

As shown, the memory system 100 of the networking element includes aternary content-addressable memory (TCAM) 105, condition selection logic110, and a memory element 115 for establishing one or more ACLs. Acontent-addressable memory (CAM) is associative memory (or associativestorage) that receives a data word and searches its entire memory to seeif that data word is stored anywhere in the memory. If the data word isfound, the CAM returns data identifying one or more storage addresseswhere the word is found. A binary content-addressable memory uses datasearch words consisting entirely of 1s and 0s; however, the TCAM 105allows a third matching state of “don't care” (“X”). Thus, if the dataword to be searched is “10010” and if the TCAM 105 stores conditions“1001X” and “1X010” in respective rows, the TCAM 105 returns dataidentifying the address of these rows—i.e., the conditions are satisfiedby the received data word.

The memory system 100 uses the TCAM 105 to store the conditions of anACL. As shown by an arrow 120, the networking element uses informationin a received data frame to search the TCAM 105, which compares, inparallel, the frame information to each condition (i.e., conditions1−N+4) stored in the rows of the TCAM 105. In this embodiment, the TCAM105 indicates which conditions are satisfied by the received frame usinga bit vector 125. Because each bit of the bit vector 125 corresponds toa row of the TCAM 105 that contains a condition for the ACL, the numberof bits in the bit vector 125 depends on the number of conditions orrules in the ACL. The bit vector 125 may use a logical “1” to indicatethat the frame information satisfied the condition and a logical “0” ifit did not. For example, if the frame header contains an IP sourceaddress that satisfies conditions 1 and 3 and a TCP source port thatsatisfies condition 9, the bit vector 125 returned by the TCAM 105 is“1010000010 . . . ” where the leftmost bit corresponds to the topmostrow of the TCAM 105.

In one embodiment, the conditions stored in the TCAM 105 are made usinga pattern and mask. For example, the pattern may be “9.00.000.0”, andthe mask may be “255.000.00.0”. The portion “255” (i.e., the highestpossible bit value for that portion of the pattern) indicates that thisportion of the pattern is to be matched precisely. Conversely, theportion of zeros (i.e., the lowest possible bit value for that portionof the pattern) indicate that these portions of the pattern are “don'tcare” bits. Thus, the resulting logic is “9.*.*.*”. Using a pattern andmask, the TCAM 105 can be programmed to determine whether differentportions of a received frame match a condition in the TCAM 105.

As discussed above, in one embodiment, the rules of an ACL are arrangedin the form of a hierarchy. Although TCAM 105 enables all conditions tobe compared to the frame information simultaneously (which speeds up theACL lookup relative to parsing each condition individually) the returnedbit vector 125 indicates all the conditions that are satisfied,regardless of the established hierarchy. Accordingly, the system 100includes condition selection logic 110 that parses through the bitvector 125 to find the first bit with a value that indicates thecondition was satisfied. In the example bit vector provided above, thecondition selection logic 110 would parse the bit vector “1010000010”from left to right and stop at the first logical “1”. The index of thevector—in this case, index[0] —is then used as the memory address toidentify the action set corresponding to the satisfied condition. Stateddifferently, the index of the bit vector indicates the highest-priorityrule with a condition satisfied by the received frame. In oneembodiment, the condition selection logic 110 may be hardware (i.e.,logic circuitry), firmware, software, or some combination thereof withinthe networking element.

In one embodiment, the index identified by the condition selection logic110 is then used by the networking element to indentify a particular rowin the memory element 115 that stores the actions sets of the ACL. Asrepresented by arrow 130, the networking element then performs thevarious actions defined in the action set returned by searching thememory element 115. In this manner, the condition stored in the TCAM 105and the action set stored in the memory element 115 are combined toyield a plurality of rules 135 for each ACL. Moreover, the TCAM 105 andmemory element 115 may be logically divided to store multiple ACLs forthe networking element in the same memory structures. For example, tenentries of the TCAM 105 and memory element 115 may be used to store afirst ACL while another ten entries are assigned to a second ACL.

Because a particular memory address (i.e., the index of the bit vector125 with the highest priority condition) is already identified, insteadof being a special type of storage element like a CAM, the memoryelement 115 may be implemented by any memory type such as SRAM, DRAM,Flash memory, or other volatile or non-volatile memory elements. Asshown, the TCAM 105 stores the conditions while the memory element 115stores the actions sets. However, this embodiment is for illustrationpurposes only; for example, the memory element 115 may be furtherdivided into different physical memory elements that each stores only aportion of the action set. Moreover, the TCAM 105 and conditionselection logic 110 may be replaced by random access memory or otherlogic in embodiments where the parallel comparisons performed by theTCAM 105 is not needed (e.g., where time is not a critical factor).

FIG. 2 is a chart 200 that matches a satisfied condition with an actionset, according to one embodiment described herein. The chart 200 isorganized to include a plurality of conditions along the X-axis and aplurality of action types along the Y-axis. The action types 1-N make upan action set 205 where each condition corresponds to exactly one actionset 205. Specifically, chart 200 may represent the organization of datain the memory element 115 shown in FIG. 1 where the conditions in theX-axis may be represented by the vector index transmitted by thecondition selection logic 110. That is, index[0] represent Condition 1,index[1] represents Condition 2, and so forth. Thus, based on the vectorindex, the chart 200 identifies the different actions associated withthe action types. For example, assume action type 1 identifies theforwarding action the networking element should perform with thereceived data frame. For Condition 1, the action for action type 1 maybe to drop the frame (or its corresponding packet), Condition 2 mayinstruct the networking element to forward the frame according to thedestination in the frame's header, and Condition 3 may instruct thenetworking element to forward the frame to a specified destinationregardless of its intended destination. In one embodiment, the ACL rules(i.e., the conditions and action sets 205) are provided by a user, suchas an administrator. That is, the networking element may includefunctionality that permits the administrator to configure the ACL byadding or subtracting rules or changing existing ones.

FIG. 3 illustrates the number of TCAM entries needed for one logicalcomparison, according to one embodiment described herein. Chart 300illustrates the 16-bit binary representation of 1023 which is used toestablish a logical comparison for TCAM. In TCP/IP, the frame headerdesignates a 16-bit portion for identifying the TCP source port (SP). Acommon rule in an ACL is performing a particular action (e.g.,discarding the packet) if the TCP SP for an incoming frame is greaterthan 1023. However, while TCAMs provide the advantage of evaluating eachstored condition in parallel, a TCAM may be unable to do certain actions(e.g., determining if a received value is within a certain range) usingonly a single rule—i.e., a single entry or row in the TCAM.

Chart 305 illustrates the number of rules or entries needed in a TCAM todetermine if a received TCP SP is greater than 1023. As shown, the ACLneeds six different rules (i.e., six different entries in the TCAM) toperform the logical comparison of TCP SP>1023. Specifically, the TCAMhas one condition (Rule 1) that determines if the received TCP SP isgreater than 32,768 as shown by the pattern+mask entry in the right handcolumn of chart 305. Rule 2 checks to see if the received TCP SP isgreater than 16,384, and so forth. If any of Rules 1-6 are satisfied,than the action is performed—e.g., the frame is dropped or re-routed.That is, Rules 1-6 may have the same action set, but the ACL uses sixdifferent conditions to ensure the logical comparison of TCP SP>1023 issatisfied.

Moreover, in some embodiments, the system administrator may want toperform a particular action if the TCP SP is greater than 1023 and ifthe TCP destination port (DP) is also greater than 1023. As can beextrapolated from chart 305, determining whether a received TCP DP portis greater than 1023 also requires using six different entries in theTCAM 105. However, to perform the logical comparisons of TCP SP>1023 andTCP DP>1023, the TCAM 105 needs 36 entries—one entry for each possiblecombination of the six respective entries of the two conditions (6*6).For example, one TCAM entry would include the pattern+mask for Rule 1 ofTCP SP as well as a pattern+mask for one of the rules associated withTCP DP. The TCAM compares both the received TCP SP and the TCP DP toeach of the 36 entries to see if the above logical comparison issatisfied. Thus, adding conditions to a logical comparison maydisproportionately increase the number of entries required in theTCAM—i.e., even though the logical comparison is only doubled in size,the number of entries increases exponentially. However, this example isfor illustration purposes only and does not limit the scope of thepresent disclosure. The embodiments disclosed herein may advantageouslybe used to minimize the number of entries used in the TCAM whenperforming any type of logical comparison.

In some embodiments, to avoid using multiple entries in the TCAM toperform one or more logic comparisons, the networking element mayinclude a special-case hardware system for performing certain selectedlogic comparisons. That is, instead of using entries in the TCAM 105 todetermine if the received frame satisfies a condition, a separatehardware unit determines if the condition established by the logiccomparison is satisfied and returns the result to the TCAM.

FIG. 4A illustrates a special-case instruction 400 for performing alogical comparison, according to one embodiment described herein. Theinstruction 400 is a 37-bit data word that may be stored in a registerin the networking element. As shown, the instruction 400 is logicallydivided into four different bit portions or fields: encode, value1,value2, and operation. In one embodiment, a system administratorprovides the instruction 400 to the networking element, which uses theinstruction 400 to configure a particular hardware system in the networkelement. Although shown as a contiguous word, the different fields ofthe instruction 400 may be stored in separate registers in thenetworking element.

FIG. 4B is a chart 405 describing the different portions of thespecial-case instruction 400 shown in FIG. 4A, according to oneembodiment described herein. Stated differently, the chart 405illustrates the different functionalities of the special-case hardwaresystem included within the network device. A system administrator usesthe functionalities illustrated in chart 405 to generate special-caseinstructions 400 to configure the hardware system to test for aparticular condition based on incoming network traffic.

In the embodiment shown in FIG. 4B, the encode field is three bits longwhere each bit combination is associated with a particular portion of anEthernet frame header—e.g., the source port, destination port, VLAN ID,TTL, L3 Protocol, EtherType, and L3 Payload length. Accordingly, if thesystem administrator wants the hardware system to evaluate a VLAN IDvalue of a received Ethernet frame, the encode field of the instruction400 is set to “010”.

In one embodiment, the system administrator sets the value1 and value2fields in the instruction 400 based on the desired condition of thelogical comparison. In one embodiment, the lengths of the value1 andvalue2 fields are set based on the largest possible value of thedifferent encode operations. For the encode fields shown in chart 405,the largest length is the source and destination ports, which are 16-bitportions. If, for example, the encode field was expanded to allow theinstruction 400 to map to an IP address (a 32-bit data word), the value1and value2 fields may both be increased to 32 bits.

In one embodiment, the operation field is a 2-bit portion of theinstruction 400 that instructs the hardware system to perform aparticular comparison. In this embodiment, the hardware system isconfigured to perform at least three operations using a received value(X) corresponding to the encode field: Value1≦X≦Value2, Value1==X ORValue2==X, and Value1 !=X AND Value2 !=X, where OR and AND are logicaloperators. Based on this field, the special-case instruction 400 directsthe hardware system to compare a portion of the received frame to thevalue1 and value2 fields provided in the instruction 400. For example,to configure a hardware system to perform the logic comparison TCPSP>1023, an administrator generates a special-case instruction with theencode field set to “000” to correspond to the source port of thereceived frame, the value1 field set to the bit representation of2^16−1, the value2 field set to the bit representation of 1024 (i.e.,2^10), and the operation field set to “00”. Once the instruction isreceived, the hardware system extracts the source port field fromincoming Ethernet frames and determines whether that value (X) isbetween the value1 and value2. If so, the hardware system may output alogical “1”, but if not, the system may output a logical “0”. In anotherexample, assume that the system administrator wants to perform a certainaction if either a received frame is either a TCP L3 Protocol type orUDP L3 Protocol type. Instead of using the TCAM to see if the L3Protocol of a received frame is one of these types, the systemadministrator may generate a special-case instruction 400 where theencode field is set to “100” to correspond to the L3 Protocol, thevalue1 field is set to the binary representation of 6 (the TCP protocolnumber), the value2 field is set to the binary representation of 17 (theUDP protocol number), and the operation field is set to “01” (i.e., testto see if Value1==X OR Value2==X). This instruction 400 configures thehardware system to determine if the L3 Protocol portion of a receivedframe header is either a 6 or a 17. So long as the received L3 Protocolis one of these numbers, the hardware system may output a logical “1”. Adetailed example of a hardware system corresponding to chart 405 isshown in FIG. 6.

The embodiment shown in chart 405 is for illustration purposes only andmay be reconfigured in various manners to achieve different goals. Forexample, other embodiments may require the addition of differentoperations such as evaluating different portions of an Ethernet frameheader (e.g., the IP source address) which may change the length of thedifferent fields. Furthermore, if the encode field maps only to fourdifferent fields of an Ethernet frame header, the length of the encodefield may be reduced to only two bits but the value1 and value2 fieldsmay be increased to 32 bits. In another example, the hardware systemcorresponding to the chart 405 may be increased to perform additionaloperations than the ones shown, or operations may be removed (e.g., thehardware system is configured to perform only the first operation).

FIG. 5 is a block diagram of a system 500 for evaluating special-caseinstructions 400A-N used in an ACL, according to one embodimentdescribed herein. System 500 includes a special-case hardware system 505and a TCAM 105, which uses the output of the hardware system 505 todetermine where a condition is satisfied. The hardware system 505includes a plurality of comparison units 510A-N that each correspond toa special-case instruction 400. In one embodiment, the systemadministrator may generate the multiple instructions 400A-N whichconfigure the different comparison units 510 in the hardware system 505to check specific conditions. For example, special-case instruction 400Amay configure comparison unit 510A to determine whether the receivedframe has a TCP SP value greater than 1023 while special-caseinstruction 400B configures comparison unit 510B to determine whetherthe L3 Protocol for the received frame is either 6 or 17. Thespecial-case instructions 400A-N may be stored as separate entries in aregister in the network element. Accordingly, the system administratormay access this register to add new instructions 400 or replace, modify,or remove the current instructions 400. In one embodiment, thenetworking element may only have as many special-case instructions 400as there are comparison units 510—e.g., if there are 32 comparison unitsthen there are 32 entries for the register storing the instructions 400.However, there may be fewer instructions 400 than comparison units,which would result in some comparison units 510 remaining unused.

Each comparison unit 510 evaluates some portion of the received frameinformation, determines whether the portion satisfies the conditionestablished by corresponding special-case instruction 400, and outputs alogic bit indicating whether the condition is satisfied. The hardwaresystem 505 combines the logic bits from the comparison units 510 togenerate a bit vector 515. The length of the bit vector 515 depends onthe number of comparison units 510 in the hardware system 505. Moreover,if a comparison unit 510 is currently not configured by to perform aspecial-case instruction 400, the unit 510 may default to alwaystransmitting a logical 0.

The results of the comparison units 510A-N, i.e., the bit vector 515, isused as one input into the TCAM 105. As shown here, the TCAM 105 has twoinputs: bit vector 515 and the frame information. In one embodiment, theframe information received at the TCAM 105 is the same frame informationreceived at the hardware system 505—e.g., the same received frame headeris routed within the networking element to both the hardware system 505and the TCAM 105. The entries in the TCAM 105 are divided into a patternand mask for the received frame information (e.g., a first sub-entry)and the pattern and mask for the result of performing the special-caseinstructions 400A-N (e.g., a second sub-entry). As discussed withregards to FIG. 1, the TCAM 105 uses the pattern and mask to storeconditions that are compared with incoming frame information todetermine if the conditions are satisfied—e.g., the pattern and maskcondition “9.*.*.*” is compared to the IP source address found in areceived frame header. In addition, each entry or row of the TCAM 105may include a pattern and mask to determine whether one of thespecial-case instructions 400 was satisfied by the received frame. Forexample, assume that special-case instruction 400A configured comparisonunit 510A to determine whether the TCP SP of a received frame is greaterthan 1023. If a rule in the ACL instructed the networking element todiscard all frames satisfying this condition, the TCAM 105 includes apattern and mask that determines whether the comparison unit 510Aoutputs a logical 1. If there are four comparison units 510, the bitpattern stored in TCAM 105 may be “1XXX” where the logical 1 correspondsto the output of comparison unit 510A in the bit vector 515. Thus, anytime the TCAM 105 receives a bit vector 515 where the first bit is alogical 1, the TCAM 105 knows that the condition of TCP SP>1023 issatisfied by the received frame.

The system administrator may also configure TCAM 105 to determine ifmore than one of the special-case instructions 400 is satisfied. Entry520 of TCAM 105 illustrates an example pattern and mask for determiningif two special-case instructions 400 are satisfied by the incomingframe. In this case, the TCAM 105 determines whether comparison unit515B returns a logical 1 and comparison unit 515N returns a logical 0(i.e., the condition is not satisfied). For example, the rule of the ACLmay want to perform an action if the TCP DP is greater than 512 and theL3 payload length is less than four. Because comparison unit 510N may beconfigured to determine whether the L3 payload length is four orgreater, if unit 510N returns a zero, than the payload length is lessthan four and the condition is satisfied. In this manner, the conditionsset in the TCAM 105 for the different comparison units may combine (orchain) the outputs of the comparison units 510A-N and detect eitherlogical 1's or 0's to determine if multiple comparison units satisfy agiven condition.

Moreover, in one embodiment, the TCAM 105 shown in FIG. 5 can furthercombine the pattern and mask for special cases and a pattern and maskfor the received frame information. That is, the entries in the TCAM 105may be wide enough that a system administrator can use the patterns andmasks in conjunction to perform rules with more complex conditions. Forexample, the system administrator may configure a single TCAM 105 entryto check whether a received IP address satisfies “9.*.*.*” using thepattern and mask for frame information and to check whether TCP SP isgreater than 1023 using the pattern and mask for special cases. In ACLrules where one of the patterns and masks is not needed, the irrelevantportion of the entry may simply be filled with don't cares. In anotherembodiment, the width of the TCAM entries may too small to accommodateplacing both types of conditions into a single entry. Accordingly, inone embodiment, the system 500 TCAM 105 include a flag bit or registerthat indicates whether the received frame information or the bit vector515 from the comparison units 510 should be compared to the entry.

If the bit vector 515 indicates that a rule's condition is satisfied,the TCAM 105 updates the bit vector 125 accordingly and transmits theinformation to the condition selection logic 110 for further processingas discussed in regards to FIG. 1. Advantageously, using a pattern andmask for the special cases may reduce the number of entries needed inthe TCAM 105. For example, instead of using six entries in the TCAM 105for checking whether TCP SP is greater than 1023, this check requiresonly one entry. Moreover, instead of using 36 entries for determiningwhether both TCP SP and DP are greater than 1023, still only one entryin the TCAM 105 is required (assuming respective comparison units 510are configured to perform these two special cases). For example, thesystem administrator may design a pattern and mask that is satisfiedonly if the bit vector 515 includes logical 1's corresponding to the twocomparison units 510 configured to check whether TCP SP>1023 and TCPDP>1023. Thus, by adding the comparison units to the networking element,the TCAM 105 may be used more efficiently, which may help to minimizethe size of the TCAM 105 or maximize the number of rules that an ACL maycontain.

FIG. 6 illustrates a hardware diagram of a comparison unit 510 shown inFIG. 5, according to one embodiment described herein. The hardwaresystem 505 includes a plurality of comparison units 510 that eachincludes hardware elements for performing the operations shown in theoperation field of chart 405 in FIG. 4B. Each comparison unit 510 mayreceive the same frame information which may include different networkfields stored in an Ethernet frame header such as source port,destination port, VLAN ID, and the like. The encode field of thespecial-case instruction is used to select one of these different headerfields using the multiplexer (mux) 605. Even though the different headerfields are of varying bit lengths, the output of mux 605 is designed tosatisfy the largest bit length—i.e., 16 bits. If a encode field selectsa header field less than 16 bits, the unused portion of the output maybe backfilled by zeros. As such, the output of the mux 605 is the value(X) that is compared against the value1 and value2 fields set in thespecial-case instruction.

The comparators 610A and 610B compare the value of input V− to the valueof input V+. If the value of V+ is greater, the comparators 610A and610B output a logical 1; else, the outputs are zero. The V− input ofcomparator 610A is X while the V+ input is value1 of the special-caseinstruction. The V− input of comparator 610B is value2 of thespecial-case instruction while the V+ input is X. Comparators 610A and610B both output logical 1's if Value2≧X≧Value1. If this condition ismet, the AND gate transmits a logical 1 to the mux 635.

Comparators 615A and 615B compare the value of input V1 to the value ofinput V2. If these values are equal, the comparators 615A and 615Boutput a logical 1; else the outputs are zero. In the comparison units510, the comparators 615A and 615B compare the received value X tovalue1 and value2, respectively. If either of the comparators 615A and615B output a one, the OR gate 625 also outputs a logic one. That is,the OR gate 625 outputs a logical 1 if either X==Value1 or X==Value2.Conversely, the output of the inverter 630 is a logical 1 only if X!=Value1 and X !=Value2—i.e., if the output of the OR gate 625 is alogical 0. In this manner, the outputs of the AND gate 620, the OR gate625, and the inverter 630 each respectively correspond to a result ofperforming one of the operations shown in chart 405 of FIG. 4B (i.e.,Value2≧X≧Value1, X==Value1 OR X==Value2, and X !=Value1 AND X !=Value2).The mux 635 uses the operation field of the special-case instruction asthe selector to signal to select which result to add to the bit vector515. That is, each comparison unit 515 contributes one bit to the bitvector 515 that is then transmitted to the TCAM (not shown).

FIG. 7 illustrates a method 700 for evaluating special-case instructionsin an ACL, according to one embodiment described herein. Method 700begins at block 705 when a networking element forwards a portion ofnetwork traffic, such a frame header, to one or more comparator unitsLike a pattern and mask in the TCAM, the comparator units are configuredto evaluate whether the network traffic satisfies a particularcondition. In one embodiment, a system administrator updates a registerto include one or more special-case instructions that configurerespective comparator units to evaluate selected conditions. The systemadministrator may select conditions that are commonly used whengenerating rules for an ACL but inefficiently use the TCAM—i.e., theTCAM requires multiple entries to determine if the condition issatisfied. Thus, when generating the ACL that uses one of these commonconditions, the system administrator may configure the pattern and maskin the TCAM to take advantage of the comparator units. Alternatively,the system administrator may have a customized condition she wants toinclude in the ACL but requires too many entries in the TCAM. Instead oftesting for this condition using the TCAM, the system administrator mayadd one or more special-case instructions into the register which theninstructs one or more of the comparator units to perform the necessarylogic. The administrator may then configure the TCAM to evaluate onlythe output of the respective comparator units without separatelychecking to see if the received network portion satisfies the condition.

At block 710, the networking element uses the comparators to determinewhether one of the special-case conditions is satisfied. In oneembodiment, the comparator units evaluate a portion of network trafficeach time the ACL is invoked. Stated differently, each time a portion ofnetwork traffic is compared to the conditions in the TCAM, thenetworking element also transmits the same network traffic portion tothe comparator units. In this manner, the comparator units process thenetwork traffic to determine whether the portion satisfies thespecial-case conditions. At block 715, if the networking elementincludes multiple comparator units, the respective outputs may becombined to form a bit vector where each bit indicates if the conditiontested by the corresponding comparator unit is satisfied by the networktraffic portion.

At block 720, the TCAM uses the bit vector received from the comparatorunits to confirm that a condition was satisfied. The TCAM includes apattern and mask entry that is compared to the bit vector. In oneembodiment, the entries of the TCAM are divided into two differentpattern and mask sub-entries: one sub-entry tests the bit vector asdescribed above while the second sub-entry is used to test the networktraffic portion directly. The condition is satisfied only if bothpattern and mask sub-entries are satisfied by the respectiveinputs—i.e., the bit vector from the comparator units and the networktraffic portion. If the bit vector satisfies the condition (orconditions) stored in the entry, at block 725, the TCAM transmits alogical 1 to the condition selection logic 725, but if not, at block730, a logical 0 is transmitted instead.

At block 735, the rest of the elements of the ACL (e.g., the conditionselection logic and the memory element) use the bit vector produced bythe TCAM to select one or more actions for the networking element toperform on the received network traffic. For example, the TCAM mayindicate that a plurality of conditions is satisfied based on thenetwork traffic portion. The condition selection logic may select onlyone of these satisfied conditions and use the location of the selectedcondition in the bit vector to index into the memory element. The memoryelement then returns one or more actions (e.g., forwarding the frame,discarding the frame, saving a copy of the frame, etc.) for thenetworking element to perform.

An Example System

FIG. 8 is a block diagram of a networking element 800, according to oneembodiment described herein. The networking element 800 includes aprocessor 810, TCAM 105, memory element 115, a register 815, and acomparator unit 510. In one embodiment, the networking element 800 maybe an integrated circuit (IC) such that the processor 510, TCAM 105,memory element 115, register 815, and comparator unit 510 are part of asingle chip. However, in other embodiments, these components of thenetworking element 800 may be part of different chips or independentunits that are communicatively coupled to form the networking element800. For example, the components may be mounted on a shared substrate(e.g., PCB) and communicatively coupled by wire traces.

In one embodiment, the processor 810 is any suitable processor forperforming the functions described herein. The processor 810 may includea plurality of different processors or a single processor with multiplecores. The TCAM 105, as described above, is an associative memoryelement that permits a data word to be compared, in parallel, to eachentry in its rows. In one embodiment, the TCAM 105 is configured using apattern and mask technique to contain a condition for each rule in anACL. The TCAM 105 compares a portion of the incoming network traffic(e.g., a header of a frame), a bit vector received from the comparatorunits 510, or both to the saved conditions to determine which conditionsare satisfied by the network traffic portion. Once a satisfied conditionis identified, the networking element 800 may use the memory element 115to look up the action set corresponding to the satisfied condition. Thatis, each condition in the TCAM 105 may correspond to a single action setstored in the memory element 115.

To efficiently use the entries in the TCAM 105, the network element 800includes a register 815 and one or more comparator units 510. Theregister 815 may be a separate storage element in the networking element800 or be logical partition within another storage element. A systemadministrator accesses the register 815 to add, remove, or update thedifferent special-case instructions 400 stored therein. Eachspecial-case instruction 400 corresponds to a comparator unit 510 andconfigures the unit 510 to test for a particular condition. In oneembodiment, instead of using only the TCAM 105 to determine whether arule's condition is satisfied, the networking element 800 transmits thenetwork traffic portion to the comparator units 510 which compare theportion to values provided by the special-case instructions 400. Theresults of this comparison may then be passed to the TCAM 105 which, incombination with the memory element 115, identifies one or more actionsfor the processor 810 to perform on the received network traffic.

In one embodiment, the networking element 800 is used to connectdifferent networks together (e.g., a WAN to a LAN) or to connect annetwork to a end device such as a server or user computing device andmay thus be part of a larger networking device, such as a Ethernetswitch, router, bridge, and the like.

CONCLUSION

In embodiments disclosed herein, ACLs permit network administrators tomanage network traffic flowing through a networking element to optimizenetwork security, performance, QoS, and the like. For example, thenetworking element may be an integrated circuit (IC) located within alarger network device—e.g., a router, switch, bridge, etc. ACLs includeone or more rules that each define a condition and one or more actionsto be performed if the condition is satisfied. In one embodiment, theconditions are stored on a ternary content-addressable memory (TCAM)which receives a portion of network traffic, such as a frame header, andcompares different portions of the header to the entries in the TCAM. Ifthe frame header satisfies the condition, the TCAM reports the match toother elements in the ACL which in turn identify an action to performbased on the condition satisfied.

For certain conditions, such as testing whether a received number fallswithin a certain numerical range, the TCAM may divide the condition intoa plurality of sub-conditions which are each stored in a row of theTCAM. As conditions become more complex, more rows of the TCAM may beneeded. To efficiently use the limited space in the TCAM, the networkingelement may include one or more comparator units which check forspecial-case conditions. The comparator units may be used in lieu of theTCAM to determine whether the condition is satisfied. Thus, instead ofdirectly determining whether the received data satisfies the condition,the TCAM monitors the output of the comparator units. In one embodiment,by using the comparator units, the TCAM needs only one entry to monitorthe output of the comparator units instead of using multiple rows toevaluate the received data.

In one embodiment, a system administrator may configure the differentcomparator units to check for different conditions. For example, onecomparator unit may check to see if a TCP source port is greater than1023 while another comparator unit determines if the received frame isassociated with a UDP packet. In one embodiment, the networking elementincludes a register accessible by the system administrator and storinginstructions for configuring the comparator units to perform differentfunctions. The administrator may access the register to add, change, orremove the different instructions, thereby changing the functions of thecomparator units associated with the entries in the register.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagrams and/or flowchartillustration, can be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

While the foregoing is directed to embodiments of the present invention,other and further embodiments of the invention may be devised withoutdeparting from the basic scope thereof, and the scope thereof isdetermined by the claims that follow.

What is claimed is:
 1. A networking element, comprising: a processor; aplurality of comparator units configured to receive a network packet,wherein each comparator unit comprises one or more hardware unitsconfigured to output a bit based on determining whether a portion of thenetwork packet satisfies a condition in an access control list (ACL),wherein the combined outputs of the plurality of comparator units arerepresented by a bit vector; a content-addressable memory (CAM)configured to receive the bit vector, from the comparator unit and, upondetermining that the bit vector satisfies an entry in the CAM, selectone or more actions corresponding to the satisfied entry to be performedby the processor, wherein the one or more actions are part of the ACL,wherein the one or more hardware units of the comparator unit areseparate from the CAM; and a register storing an instruction, theinstruction comprising at least one comparison value and an operationcode, wherein the comparator unit is configured to compare thecomparison value of the instruction to the network packet portion usingan operation defined by the operation code of the instruction.
 2. Thenetworking element of claim 1, wherein the networking element is asingle integrated circuit.
 3. The networking element of claim 1, whereinthe networking element is part of a network device that routes networktraffic between an end point and a communication network.
 4. Thenetworking element of claim 1, wherein the CAM is a ternary contentaddressable memory.
 5. The networking element of claim 1, wherein thenetwork packet evaluated by the comparator units is also transmitted tothe CAM, the CAM is configured to determine whether at least a portionof received network packet and the bit vector satisfy the entry in theCAM.
 6. The networking element of claim 1, wherein the ACL comprises aplurality of rules for determining a set of actions to be performed bythe networking element, one of the rules comprising the condition andthe one or more actions.
 7. The networking element of claim 1, whereinthe CAM determines that the ACL condition contained in the entry of theCAM has been satisfied by isolating a portion of the bit vector with asuitable pattern and mask.
 8. The networking element of claim 1, whereineach of the comparator units comprises selection circuitry configured toselect a portion of the network packet for evaluation by the one or morehardware units, wherein at least two of the comparator units evaluatedifferent portions of the network packet.
 9. A computer program product,comprising: A non-transitory computer-readable medium havingcomputer-readable program code embodied therewith, the computer-readableprogram code configured to: receive a network packet using a pluralityof comparator units of a networking element, wherein each comparatorunit comprises one or more hardware units configured to output a bitbased on determining whether a portion of the network packet satisfies acondition in an ACL, wherein the combined outputs of the plurality ofcomparator units are represented by a bit vector; configure each of thecomparator units to compare a comparison value to the network packetportion based on an operation represented by an operation code, whereinthe comparison value and the operation code are part of an instructionstored on the networking element; transmit, from the comparator unit,the bit vector to a CAM, wherein the CAM is separate from the one ormore hardware units; and upon determining that the bit vector satisfiesan entry in the CAM, select one or more actions corresponding to thesatisfied entry to be performed by the networking element, wherein theone or more actions are part of the ACL.
 10. The computer programproduct of claim 9, wherein the ACL comprises a plurality of rules fordetermining a set of actions to be performed by the networking element,one of the rules comprising the condition and the one or more actions.11. The computer program product of claim 9, further comprisingcomputer-readable program code configured to: compare the network packetportion to a first sub-entry stored in the entry of the CAM; and comparethe bit vector to a second sub-entry stored in the entry of the CAM,wherein the entry is satisfied only if the network packet portionsatisfies the first sub-entry in the entry and the bit vector satisfiesthe second sub-entry in the entry.
 12. The computer program product ofclaim 9, wherein the networking element is part of a network device thatroutes network traffic between an end point and a communication network.13. The computer program product of claim 9, wherein the CAM is aternary content addressable memory.
 14. The computer program product ofclaim 9, wherein the network packet evaluated by the comparator units isalso transmitted to the CAM, the CAM is configured to determine whetherat least a portion of received network packet and the bit vector satisfythe entry in the CAM.
 15. The computer program product of claim 9,further comprising computer-readable program code configured to:determine whether the ACL condition contained in the entry of the CAMhas been satisfied by isolating a portion of the bit vector with asuitable pattern and mask.
 16. The computer program product of claim 9,wherein each of the comparator units comprises selection circuitryconfigured to select a portion of the network packet for evaluation bythe one or more hardware units, wherein at least two of the comparatorunits evaluate different portions of the network packet.